// 综合原型链继承可以共享方法和盗用构造函数可以传参的优点
function SuperType(name) {
    this.name = name || 'super'
}
SuperType.prototype.getName = function() {
    console.log(`my name is ${this.name}`);
}
function SubType(name, age) {
    SuperType.call(this, name)
    this.age = age
}
// constructor已经丢失
SubType.prototype = new SuperType()
SubType.prototype.sayAge = function() {
    console.log(`my age is ${this.age}`);
}
let instance = new SubType('zzyy', 100)
instance.getName()
instance.sayAge()